<html>
<head>
	<style type="text/css">
	#container {
		background-color: red;
		text-align: center;
		line-height: 100px;
	}
	</style>
	<script>
	function init() {
		var div0 = document.getElementById('container');
		// 改变div的内容
		div0.innerHTML = 'hello world';
		// 改变div颜色
		div0.style.backgroundColor = 'blue';

		var div1 = document.getElementById('smith');


		var gets = function(id) {
			return document.getElementById(id);
		};

		var div2 = gets('lige');
		div2.innerHTML = 'sssssss';

	}
	</script>
</head>
<body onload="init()">
	<div id="container">
		smith
	</div>
	<div id="smith"></div>
	<div id="lige">s</div>
</body>
</html>